package com.yssystem.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yssystem.domain.Do.SysMenuDO;
import com.yssystem.domain.SysLoginLog;

import com.yssystem.domain.vo.R;
import com.yssystem.domain.vo.SysLoginLogVO;
import com.yssystem.service.SysLoginLogService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

@RestController
@CrossOrigin
@RequestMapping("loginLog")
public class LoginLogController {
    @Autowired
    private SysLoginLogService sysLoginLogService;
    @GetMapping
    public R getLogList(Integer current, Integer size, String name){
        IPage page = new Page<>(current, size);
        QueryWrapper<SysLoginLog> queryWrapper = new QueryWrapper<>();
        queryWrapper.like(name!=null,"username",name);


        return new R(true,"查找",sysLoginLogService.pageMaps(page,queryWrapper));
    }
}
